package main

import (
	"gitee.com/DonHz/cloud-file-storage/service/account/handler"
	"gitee.com/DonHz/cloud-file-storage/service/account/proto"
	"github.com/go-micro/plugins/v4/registry/consul"
	"go-micro.dev/v4"
	"go-micro.dev/v4/registry"
)

func main() {
	registry := consul.NewRegistry(registry.Addrs("127.0.0.1:8500"))
	// create a new service
	service := micro.NewService(
		micro.Name("go.micro.service.user"),
		micro.Handle(new(proto.UserServiceHandler)),
		micro.Registry(registry),
	)

	// initialise flags
	service.Init()

	proto.RegisterUserServiceHandler(service.Server(), new(handler.UserService))
	// start the service
	service.Run()
}
